using System;
using System.Collections.Generic;
using System.Text;

namespace TestImport.Printen
{
    class PrintenDemo
    {/*
        private void GenerateReport(bool preview)
        {
            string spacer = " ".PadLeft(63);
            StringBuilder sb = new StringBuilder();
            // create two column headers, can have max of 4
            string ch1 = "Field1".PadRight(15) +
              "Longer Field2".PadRight(28) +
              "Field3 Heading".PadRight(25) +
              "Counter".PadRight(12) + "  ****";
            string ch2 =
              "Header".PadRight(15) +
              "Line2 of Heading".PadRight(28) +
              "Heading Line 2".PadRight(25) +
              "Of Lines".PadRight(12) + "  ****";
            int total = 5;

            // generate the detail lines (Dummy Data)
            // This string would normally be created from a datatable from
            // from a database query, so that the For Loop would be processing
            // data from a datatable, dataset,....
            for (int i = 1; i <= 100; i++)
            {
                sb.Append(("Col" + i.ToString() + "Data").PadRight(15) +
                  ("Field 2 Data for Line " + i.ToString()).PadRight(28) +
                  ("Data Field 3 for Line " + i.ToString()).PadRight(25) +
                  total.ToString().PadLeft(12) + "  Broebel  " + Environment.NewLine);
                //sb.Append("<:LINES>"+Environment.NewLine);
                total += 5;
            }
            // now we will pretend to have had a total break and change the
            // subtitle, after forcing a page change
            sb.Append(Environment.NewLine + " ".PadLeft(63) +
              "Total" + total.ToString().PadLeft(12) + Environment.NewLine);

            sb.Append("<:SUBTITLE1>My New SubTitle Heading Line" + Environment.NewLine);
            sb.Append("<:SUBTITLE2>New SubTitle 2 - for Testing" + Environment.NewLine);
            sb.Append("<:NEWPAGE>" + Environment.NewLine);

            // create some more data
            total = 5;
            for (int i = 1; i <= 40; i++)
            {
                sb.Append(("Col" + i.ToString() + "Data").PadRight(15) +
                  ("Field 2 Data for Line " + i.ToString()).PadRight(28) +
                  ("Data Field 3 for Line " + i.ToString()).PadRight(25) +
                  total.ToString().PadLeft(12) + "  Broebel  " + Environment.NewLine);
                total += 5;
                sb.Append("" + Environment.NewLine);
            }
            sb.Append(Environment.NewLine + " ".PadLeft(63) +
               "Total" + total.ToString().PadLeft(12) + Environment.NewLine);

            // finally, set up & print the report
            // instantiate the object
            cprs = new CPrintReportStringDemo.CPrintReportString();

            // set the title font points size and style
            cprs.TitleFontSize = 14;
            cprs.TitleFontStyle = TitleStyle.BoldItalic;

            // box the report if requested
            if (this.chkBoxed.Checked)
                cprs.DrawBox = true;

            // get margin extenders if any
            cprs.LeftMarginExtender = GetMarginExtenders(this.lmExtCB.Text);
            cprs.RightMarginExtender = GetMarginExtenders(this.rmExtCB.Text);
            cprs.TopMarginExtender = GetMarginExtenders(this.tmExtCB.Text);
            cprs.BottomMarginExtender = GetMarginExtenders(this.bmExtCB.Text);

            // add extra subtitles
            cprs.SubTitle2 = "This is SubTitle Number 2 (Can have up to four)";
            cprs.SubTitle3 = "This is SubTitle Number 3 (Can have up to four)";
            cprs.SubTitle4 = "This is SubTitle Number 4 (Can have up to four)";

            // call the print or preview method
            string title = "Demo Report";
            string subTitle = "SubTitle1 - Test Data Only";

            if (preview)
            {
                if (this.optPortrait.Checked)
                    cprs.PrintOrPreview(CharsPerLine.CPL120,
                      sb.ToString(), title, subTitle, PrintPreview.Preview,
                      PrintOrientation.Portrait, ch1, ch2);
                else
                    cprs.PrintOrPreview(CharsPerLine.CPL120,
                      sb.ToString(), title, subTitle, PrintPreview.Preview,
                      PrintOrientation.Landscape, ch1, ch2);
            }
            else
            {
                if (!this.optPortrait.Checked)
                    cprs.PrintOrPreview(CharsPerLine.CPL80,
                      sb.ToString(), title, subTitle, PrintPreview.Print,
                      PrintOrientation.Portrait, ch1, ch2);
                else
                    cprs.PrintOrPreview(CharsPerLine.CPL80,
                      sb.ToString(), title, subTitle, PrintPreview.Print,
                      PrintOrientation.Landscape, ch1, ch2);
            }
        }
        private MarginExtender GetMarginExtenders(string ext)
        {
            switch (ext)
            {
                case "One Tenth Inch": return MarginExtender.OneTenthInch;
                case "One Qtr Inch": return MarginExtender.OneQuarterInch;
                case "One Half Inch": return MarginExtender.OneHalfInch;
                case "Three Qtr Inch": return MarginExtender.ThreeQuarterInch;
                case "One Inch": return MarginExtender.OneInch;
                default: return MarginExtender.None;
            }
        }*/
    }
}
